// xiamiBoard.IR_callbackUser(function (message) {
//     if (message == 9) {
//         xiamiBoard.setRelay(RELAY.CLOSE)
//     } else if (message == 13) {
//         xiamiBoard.setRelay(RELAY.DISCON)
//     }
// })

// xiamiBoard.initXiaMiBoard()

// xiamiBoard.setIndexColor(xiamiBoard.ledRange(1, 2), 0xff0000)
// xiamiBoard.OLEDshowUserText("M1CW", 0, 0)
// xiamiBoard.motorRun(MOTOR.M1, DIRECTION.CW, 255)
// basic.pause(2000)
// xiamiBoard.OLEDshowUserText("M1CCW", 0, 5)
// xiamiBoard.motorRun(MOTOR.M1, DIRECTION.CCW, 255)
// basic.pause(2000)
// xiamiBoard.OLEDshowUserText("Stop1", 0, 11)
// xiamiBoard.motorStop(MOTOR.M1)
// basic.pause(2000)
// xiamiBoard.setIndexColor(xiamiBoard.ledRange(1, 2), 0xff8000)
// xiamiBoard.OLEDshowUserText("M2CW", 1, 0)
// xiamiBoard.motorRun(MOTOR.M2, DIRECTION.CW, 255)
// basic.pause(2000)
// xiamiBoard.OLEDshowUserText("M2CCW", 1, 5)
// xiamiBoard.motorRun(MOTOR.M2, DIRECTION.CCW, 255)
// basic.pause(2000)
// xiamiBoard.OLEDshowUserText("Stop2", 1, 11)
// xiamiBoard.motorStop(MOTOR.M2)
// basic.pause(2000)
// xiamiBoard.setIndexColor(xiamiBoard.ledRange(1, 2), 0xb09eff)
// xiamiBoard.OLEDshowUserText("M3CW", 2, 0)
// xiamiBoard.motorRun(MOTOR.M3, DIRECTION.CW, 255)
// basic.pause(2000)
// xiamiBoard.OLEDshowUserText("M3CCW", 2, 5)
// xiamiBoard.motorRun(MOTOR.M3, DIRECTION.CCW, 255)
// basic.pause(2000)
// xiamiBoard.OLEDshowUserText("Stop3", 2, 11)
// xiamiBoard.motorStop(MOTOR.M3)
// basic.pause(2000)
// xiamiBoard.setIndexColor(xiamiBoard.ledRange(1, 2), 0x00ffff)
// xiamiBoard.OLEDshowUserText("M4CW", 3, 0)
// xiamiBoard.motorRun(MOTOR.M4, DIRECTION.CW, 255)
// basic.pause(2000)
// xiamiBoard.OLEDshowUserText("M4CCW", 3, 5)
// xiamiBoard.motorRun(MOTOR.M4, DIRECTION.CCW, 255)
// basic.pause(2000)
// xiamiBoard.OLEDshowUserText("Stop4", 3, 11)
// xiamiBoard.motorStop(MOTOR.M4)
// basic.pause(2000)
// xiamiBoard.setIndexColor(xiamiBoard.ledRange(1, 2), 0xff0080)
// basic.forever(function () {
//     xiamiBoard.motorRun(MOTOR.M1, DIRECTION.CW, 50)
//     basic.pause(1000)
//     xiamiBoard.motorRun(MOTOR.M1, DIRECTION.CCW, 50)
//     basic.pause(1000)
// })

// basic.forever(function () {
//     //xiamiBoard.clear(4, 3, 6)
//     xiamiBoard.OLEDshowUserText("AE:" + xiamiBoard.readAngle(), 4, 0)
//     //xiamiBoard.clear(5, 3, 6)
//     xiamiBoard.OLEDshowUserText("FE:" + xiamiBoard.readFlre(), 5, 0)
//     //xiamiBoard.clear(6, 14, 16)
//     xiamiBoard.OLEDshowUserText("IR:" + xiamiBoard.IR_read(), 6, 11)
//     //xiamiBoard.clear(6, 3, 4)
//     //xiamiBoard.OLEDshowUserText("MD:" + xiamiBoard.motorState(MOTOR1.M1, STATE.DIR), 6, 0)
//     //xiamiBoard.clear(6, 8, 11)
//     //xiamiBoard.OLEDshowUserText("MS:" + xiamiBoard.motorState(MOTOR1.M1, STATE.SPEED), 6, 5)
//     //xiamiBoard.clear(7, 5, 8)
//     xiamiBoard.OLEDshowUserText("TEMP:" + xiamiBoard.readSensor(SENSOR.AHT20, PARA.TEMP), 7, 0)
//     //xiamiBoard.clear(7, 12, 16)
//     xiamiBoard.OLEDshowUserText("HUM:" + xiamiBoard.readSensor(SENSOR.AHT20, PARA.HUM), 7, 8)
//     //xiamiBoard.OLEDshowUserText("R:" + xiamiBoard.LEDState(LED.RD), 5, 7)
//     //xiamiBoard.OLEDshowUserText("Y:" + xiamiBoard.LEDState(LED.YW), 5, 10)
//     //xiamiBoard.OLEDshowUserText("G:" + xiamiBoard.LEDState(LED.GN), 5, 13)
//     //xiamiBoard.clear(4, 10, 16)
//     xiamiBoard.OLEDshowUserText("UR:" + xiamiBoard.Ultrasonic(), 4, 8)
// })
